#ifndef __EZFB_FONT_REDERING_FUNCTIONS__
#define __EZFB_FONT_REDERING_FUNCTIONS__

//############################################################################

#include "ezfb_types.h"
#include "ezfb_pixels.h"
#ifdef __cplusplus
extern "C" { 
#endif 

#define HZK12    0 
#define HZK16	 1

#define UNI_CHR_COUNT 7445

#define FILE_HZK12    "/Program Files/WM5Test2/hzk12"
#define FILE_HZK16    "/Program Files/WM5Test2/hzk16"
#define FILE_UNICODE  "/Program Files/WM5Test2/unicode.txt"
#define FILE_GB2312   "/Program Files/WM5Test2/gb2312.txt"

typedef void (* PUT_PIXEL_FUNC)(void *, int, int) ; 

// display char funcs
int ezfb_font_open() ; 

// display ascii char and string in 8x16 mode
void ezfb_disp_ascii_chr(struct ezfb* fb, int x, int y, char ch, u_int color) ; 
void ezfb_disp_ascii_str(struct ezfb* fb, int x, int y, 
			 			int line_chr_count, char * s, u_int color) ;

// display hz chars in 16x16 and 12x12 mode
void ezfb_disp_hz16_chr(struct ezfb* fb, int x,int y,char * gb,u_int color) ; 
void ezfb_disp_hz12_chr(struct ezfb* fb, int x, int y, char * gb, u_int color) ; 

// display hz ascii mixed string in 16x16 and 12x12 mode
// ascii string will remain 8x16 mode in both hz display mode
void ezfb_disp_mix16_str(struct ezfb* fb, int x, int y, char * gb, u_int color) ; 
void ezfb_disp_mix12_str(struct ezfb* fb, int x, int y, char * gb, u_int color) ; 

// calculate the hz ascii mixed string width in pixels
int ezfb_mix16_str_width(const char * gb) ; 
int ezfb_mix12_str_width(const char * gb) ; 

// convert unicode into gb2312 code
int ezfb_uni2gb_chr(u_char * gb, u_char * uni) ; 
int ezfb_uni2gb_str(u_char * gb, u_char * uni) ;

// convert utf8 to unicode 
int ezfb_utf82uni_str(u_char * uni, u_char * utf8, int buf_size) ; 

// display to other media, the caller must provide the outer put_pixel functions
// looks like PUT_PIXEL_FUNC, the data means outer param, x, y means start pos
void ezfb_mem_ascii_chr(int x, int y, char ch, 
						PUT_PIXEL_FUNC pf, void * data) ; 
						
void ezfb_mem_ascii_str(int x, int y, int line_chr_count, char * s,
						PUT_PIXEL_FUNC pf, void * data) ; 
						
void ezfb_mem_hz16_chr(int x, int y, char * gb, 
						PUT_PIXEL_FUNC pf, void * data) ; 
						
void ezfb_mem_hz12_chr(int x, int y, char * gb,
						PUT_PIXEL_FUNC pf, void * data) ; 
						
void ezfb_mem_mix16_str(int x, int y, char * gb,
						PUT_PIXEL_FUNC pf, void * data) ; 
						
void ezfb_mem_mix12_str(int x, int y, char * gb,
						PUT_PIXEL_FUNC pf, void * data) ; 

void ezfb_font_close() ; 

#ifdef __cplusplus
}
#endif
#endif

